
namespace ShoppingCart.Business.Logic
{
	using System;
	using System.Collections.Generic;
	using ShoppingCart.Business.Entity;
	using ShoppingCart.DataAccess;

	/// <summary>
	/// Represents the Manager of Banco.
	/// </summary>
	[Serializable]
	public class BancoManager : Singleton<BancoManager>
	{
		#region Methods

		/// <summary>
		/// Selects all records from the Banco table.
		/// </summary>
		public IList<Banco> Listar()
		{
			try
			{
				return BancoData.Instancia.Listar();
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Selects a single record from the Banco table.
		/// </summary>
		public Banco Obtener(int idBanco)
		{
			try
			{
				return BancoData.Instancia.Obtener(idBanco);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Saves a record to the Banco table.
		/// </summary>
		public int Agregar(Banco banco)
		{
			try
			{
				return BancoData.Instancia.Agregar(banco);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Updates a record in the Banco table.
		/// </summary>
		public bool Modificar(Banco banco)
		{
			try
			{
				return BancoData.Instancia.Modificar(banco);
			}
			catch (Exception) { throw; }
		}

		/// <summary>
		/// Deletes a record from the Banco table by its primary key.
		/// </summary>
		public bool Eliminar(int idBanco)
		{
			try
			{
				return BancoData.Instancia.Eliminar(idBanco);
			}
			catch (Exception) { throw; }
		}

		#endregion
	}
}
